#!/bin/bash

SELF_PATH=$( cd -- $( dirname -- ${BASH_SOURCE} ) &> /dev/null && pwd )

# Check OS
function get_os_info() {
  if [[ $(id -u) == 0 ]]; then
    source /etc/os-release
    if [[ ${ID} == "altlinux" ]]; then
      if [[ ${VERSION_ID} -ge 10 ]]; then
        \. ${SELF_PATH}/${ID}/${ID}_${ALT_BRANCH_ID}_setup.sh
      else
        echo "So old OS version :("
        exit 1
      fi
    elif [[ ${ID} == "linuxmint" ]]; then
      if [[ ${VERSION_CODENAME} == "faye" ]]; then
        \. ${SELF_PATH}/${ID}/${ID}_${VERSION_CODENAME}_setup.sh
      fi
    fi
  else
    echo "Root privileges are required (use 'sudo -s' or 'su -')"
    exit 1
  fi
}

get_os_info
